package edu.nf.supermarket.mapper;

import edu.nf.supermarket.entity.ProductSpec;
import edu.nf.supermarket.entity.ProductSpecRelations;
import edu.nf.supermarket.entity.SpecAttributes;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author gwf
 * @date 2025-06-18
 */
public interface ProductSpecMapper {

    /**
     * 根据商品ID获取商品规格属性
     */
    List<ProductSpec> getProductSpecsByProductId(@Param("productId") Integer productId);

    /**
     * 根据规格ID获取规格属性
     */
    List<SpecAttributes> getAttributesBySpecId(@Param("specId") Integer specId);

    /**
     * 获取所有启用规格
     */
    List<ProductSpec> getAllActiveSpecs();

    /**
     * 根据规格ID获取规格信息
     */
    ProductSpec getSpecById(@Param("specId") Integer specId);
}
